﻿<Application 
  x:Class="DialogEditor.App"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:pg="http://schemas.denisvuyka.wordpress.com/wpfpropertygrid"
  xmlns:local="clr-namespace:DialogEditor"   
  StartupUri="Window1.xaml">
  <Application.Resources>

    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

    <DataTemplate x:Key="{x:Static local:EditorKeys.FilePathPickerEditorKey}">
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="1*"/>
          <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>

        <TextBox Grid.Column="0" 
                 Text="{Binding StringValue}" 
                 IsReadOnly="True"
                 ToolTip="{Binding Value}"/>

        <Button Grid.Column="1" Margin="2,0,0,0" Content="..." Width="20" 
              Command="pg:PropertyEditorCommands.ShowDialogEditor"
              CommandParameter="{Binding}"
              Visibility="{Binding IsEditable, Converter={StaticResource BooleanToVisibilityConverter}}"/>
      </Grid>
    </DataTemplate>

  </Application.Resources>
</Application>
